//统一管理项目地址
import fetch from "./fetch";
//导入的node.js组件方法
import qs from "qs"
import request from "./request"

//请求游记推荐数据
export const ApiTravelsData = () => fetch("/index/banners/travel");
//请求首页旅游日记数据
export const ApiTravelDiaryData = (orderType,currentPage) => fetch(`/travels/query?orderType=${orderType}&currentPage=${currentPage}`);
//登录请求
export const ApiLogin = (params) => fetch("/users/login",qs.stringify(params),"POST")
//检查手机号是否注册
// export const ApiCheckPhone = (params) => fetch(`/users/checkPhone?phone=${params}`);
// 检查手机号是否注册
export const ApiCheckPhone= (params) => request.get('/users/checkPhone', { params })
//发送验证码
export const ApiSendVerifyCode = (params) => fetch("/users/sendVerifyCode",qs.stringify(params),"POST")
//用户注册
export const ApiRegist = (params) => fetch("/users/regist",qs.stringify(params),"POST")
// 热门目的地
// export const ApiSearchPlace = (params) => fetch("/destinations/search",qs.stringify(params))
export const ApiSearchPlace= (params) => request.get('/destinations/search', { params })

// 旅游攻略列表
// export const ApiStrategyList= (params) => request.get('/strategies/query', { params })
export const ApiStrategyList= (params) => fetch("/strategies/query",qs.stringify(params));

// 旅游攻略主题 /strategies/themes
export const ApiStrategySubject = () => fetch("/strategies/themes");

//请求旅游日记下拉框限制数据
export const ApiTravelDiaryList = (orderType,currentPage,perExpendType,dayType) => fetch(`/travels/query?orderType=${orderType}&perExpendType=${perExpendType}&dayType=${dayType}&currentPage=${currentPage}`);

// 旅游攻略详情
export const ApiStrategiesDetail = (params) => request.get("/strategies/detail",{params});

// 旅游日记详情 /travels/detail
export const ApiTravelDetail = (params) => request.get("/travels/detail",{params});
// export const ApiTravelDetail = (params) => fetch("/travels/detail",qs.stringify(params));;
